/**
*      author: Y_Yao
*      created: 2025-02-01 20:03:06
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 50 + 7;
int n,m;
char S[N][N],T[N][N];

bool check(int a,int b)
{
    if(n - a + 1 < m || n - b + 1 < m) return false;
    int ti = 1;
    for(int i = a;i < a + m;i++,ti++)
    {
        int tj = 1;
        for(int j = b;j < b + m;j++,tj++)
        {
            if(S[i][j] != T[ti][tj])
            {
                return false;
            }
        }
    }
    return true;
}

void solve()
{
    cin >> n >> m;
    for(int i = 1;i <= n;i++)
    {
        for(int j = 1;j <= n;j++)
        {
            cin >> S[i][j];
        }
    }

    for(int i = 1;i <= m;i++)
    {
        for(int j = 1;j <= m;j++)
        {
            cin >> T[i][j];
        }
    }

    for(int i = 1;i <= n;i++)
    {
        for(int j = 1;j <= n;j++)
        {
            if(check(i,j))
            {
                cout << i << " " << j << endl;
                return;
            }
        }
    }

}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}